import React from 'react';
import { View } from 'react-native';
import AudioPlayer from '../components/AudioPlayer';
import SongItem from '../components/SongItem';

const PlaylistPage = ({ route }) => {
  const { playlist } = route.params;

  return (
    <View style={styles.container}>
      <AudioPlayer currentTrack={playlist.songs[0]} />
      <View style={styles.songs}>
        {playlist.songs.map((song, index) => (
          <SongItem key={index} song={song} />
        ))}
      </View>
    </View>
  );
};

export default PlaylistPage;